/*******************************************************************************
Run All Files Main

Replication code for "Culture and gender allocation of tasks: source country 
	characteristics and the division of non-market work among US immigrants" in
	Review of Economics of the Household

Authors: Francine Blau, Lawrence Kahn, Matthew Comey, Amanda Eng, Pamela 
	Meyerhofer, and Alexander Willen
	
Date: 10/19/2020

Description: This code runs all table and figure code to reproduce materials 
	published in Blau, Kahn, et al (2020)

*******************************************************************************/


/*******************************************************************************

0. Settings

Note: Make sure to set file path on line 33 and adjust replication data and code 
location as necessary on lines 36 and 37

*******************************************************************************/

clear all

***A. Directory Setting

*Set master directory
global wdir "[INSERT FILE PATH HERE]/BKCEMW Replication Materials"

*Set input folders
global data "$wdir/Data"
global code "$wdir/Code"

*Set output folders
cap mkdir "$wdir/Table Output"
global tables "$wdir/Table Output"

cap mkdir "$wdir/Figure Output"
global figures "$wdir/Figure Output"

cap mkdir "$wdir/Log"
global log "$wdir/Log"

*Set ado
sysdir set PERSONAL "$code/ado"


***B. Other Stata Settings
set more off
graph set window fontface "Times New Roman"


***C. Non-base commands used
ssc install outreg2, replace


***D. Log
cap log close
log using "$log/Main_Analaysis", replace text


/*******************************************************************************

I. Main Tables and Figures

*******************************************************************************/

use "$data/main_data.dta", clear

*Set primary non-market work definitions
global nmw nmw_total  
global hwork nmw_housework
global ccare nmw_ccare


***A. Run Sample Restrictions, Generate Weighting Variable
do "$code/00_01_Primary_Sample_Restriction.do"


***B. Figure

**i. Figure 1
do "$code/01_01_Figure_1.do"


***C. Main Tables

**i. Table 1
do "$code/02_01_Table_1.do"

**ii. Table 2
do "$code/02_02_Table_2.do"

**iii. Table 3
do "$code/02_03_Table_3.do"

**iv. Table 4
do "$code/02_04_Table_4.do"

**v. Table 5
do "$code/02_05_Table_5.do"

**vi. Table 6
do "$code/02_06_Table_6.do"

**vii. Table 7
do "$code/02_07_Table_7.do"

**viii. Table 8
do "$code/02_08_Table_8.do"

**ix. Table 9
do "$code/02_09_Table_9.do"


***D. Appendix Tables

**i. Table 10
do "$code/02_10_Table_10.do"

**ii. Table 11
do "$code/02_11_Table_11.do"

**iii. Table 12
do "$code/02_12_Table_12.do"

**iv. Table 13
do "$code/02_13_Table_13.do"



log close